<template>
  <div class="check_box">
    <a-radio-group v-bind="bind" :value="value" @update:value="change">
      <a-row>
        <a-radio
          v-for="(item, index) in struct"
          :key="index"
          :value="item.value"
          >{{ item.label }}</a-radio
        >
      </a-row>
    </a-radio-group>
  </div>
</template>
<script lang="ts">
import { ref, PropType, defineComponent, computed } from "vue";
interface struct {
  label: string;
  value: string;
}

export default defineComponent({
  props: {
    struct: {
      type: Array as PropType<Array<struct>>,
      default: () => [],
    },
    value:Object
  },
  name: "DRadio",
  setup(props,{emit,attrs}) {
    const change = (value:any) => {
      emit('update:value',value)
    }
    const bind = computed(()=>{
      return attrs;
    })
    return {
      change,
      bind
    };
  },
});
</script>

<style scoped>
</style>